<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./js/axios-0.20.0.js"></script>
  <script src="./js/qs-6.9.4.js"></script>
</head>

<body>
  <script>
    let qs = Qs;
    // 请求拦截器
    axios.interceptors.request.use(config => {
      console.log(config);
      if (config.method == 'post' && config.url != 'http://121.199.0.35:8888/user/login') {
        config.data = qs.stringify(config.data)
      }
      // Do something before request is sent
      return config;
    }, error => {
      // Do something with request error
      return Promise.reject(error);
    });
    axios.get(
      "http://121.199.0.35:8888/index/carousel/findAll",
      { id: 1, username: '张三' }
    );
    axios.post(
      "http://121.199.0.35:8888/user/login",
      { id: 1, username: '张三' }
    )
  </script>
</body>

</html>